<template>
  <VCharts
      v-if="renderChart"
      :option="options"
      :autoresize="autoResize"
      :style="{ width, height }"
  />
</template>

<script setup>
import VCharts from 'vue-echarts';
</script>

<script>
import { nextTick } from 'vue';
// 百度EChart封装
export default {
  name: "Chart",
  components:{},
  props:{
    options: {
      type: Object,
      default() {
        return {};
      },
    },
    autoResize: {
      type: Boolean,
      default: true,
    },
    width: {
      type: String,
      default: '100%',
    },
    height: {
      type: String,
      default: '100%',
    },
  },
  data() {
    return {
      renderChart:false,
    }
  },
  mounted() {
    nextTick(() => {
      this.renderChart = true;
    });
  }
}
</script>

<style scoped>

</style>
